package com.guangaiboen.attendance.core.dispatcher.context;


import com.guangaiboen.attendance.core.dispatcher.domain.DispatcherRequest;

public class DispatcherContext {

    private DispatcherRequest dispatcherRequest;

    /**
     * 重试次数
     */
    @Deprecated
    private Integer retryDispatcherCount;

    /**
     * 连接超时时间 - 建立连接超时时间 - 此项会覆盖全局配置
     */
    private Integer connectionTimeout;

    /**
     * 请求超时时间 - 从服务端获取响应数据的超时时间 - 此项会覆盖全局配置
     */
    private Integer socketTimeout;

    /**
     * 连接获取时间 - 从连接管理器获取连接的超时时间 - 此项会覆盖全局配置
     */
    private Integer connectionRequestTimeout;

    /**
     * 时间消耗：毫秒
     */
    private Long timeConsuming;

    /**
     * 请求报文
     */
    private String requestBody;

    /**
     * 返回报文
     */
    private String responseBody;

    //Constructor
    public DispatcherContext(DispatcherRequest dispatcherRequest) {
        this.dispatcherRequest = dispatcherRequest;
    }

    public DispatcherRequest getDispatcherRequest() {
        return dispatcherRequest;
    }

    public void setDispatcherRequest(DispatcherRequest dispatcherRequest) {
        this.dispatcherRequest = dispatcherRequest;
    }

    public Integer getRetryDispatcherCount() {
        return retryDispatcherCount;
    }

    public void setRetryDispatcherCount(Integer retryDispatcherCount) {
        this.retryDispatcherCount = retryDispatcherCount;
    }

    public Integer getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(Integer connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public Integer getSocketTimeout() {
        return socketTimeout;
    }

    public void setSocketTimeout(Integer socketTimeout) {
        this.socketTimeout = socketTimeout;
    }

    public Integer getConnectionRequestTimeout() {
        return connectionRequestTimeout;
    }

    public void setConnectionRequestTimeout(Integer connectionRequestTimeout) {
        this.connectionRequestTimeout = connectionRequestTimeout;
    }

    public Long getTimeConsuming() {
        return timeConsuming;
    }

    public void setTimeConsuming(Long timeConsuming) {
        this.timeConsuming = timeConsuming;
    }

    public String getRequestBody() {
        return requestBody;
    }

    public void setRequestBody(String requestBody) {
        this.requestBody = requestBody;
    }

    public String getResponseBody() {
        return responseBody;
    }

    public void setResponseBody(String responseBody) {
        this.responseBody = responseBody;
    }
}
